home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swaga_c.zip / COMM.SWG / 0027_Another Ring Detect.pas < prev    next >
Pascal/Delphi Source File  |  1993-08-27  |  1KB  |  44 lines

  1. {
  2. MIKE MOSSERI
  3.  
  4. >  Does anyone have any bbs routines that they recommend.  I'd prefer if
  5. >it came With source but one that doesn't is good.  Mostly I want the
  6. >modem routines.  Also does anyone have a routine to answer the phone and
  7. >tell the baud rate of connection?  I working on a bbs Program (mostly
  8. >just For myself, small and quick) and Im doing it from scratch.  Im have
  9. >some communication routines but Im looking For others made For bbs's.
  10. }
  11.  
  12.  
  13. Uses
  14.   Dos, Crt;
  15.  
  16. Var
  17.   REGS : Registers;
  18.  
  19. Function CheckRing(Comport : Byte) : Boolean;
  20. begin
  21.   fill(Regs, SizeOf(Regs), 0);    {Reset All Registers}
  22.   Regs.AH := 3;
  23.   Regs.DX := Comport - 1;
  24.   Intr($14, Regs);
  25.   CheckRing:= ((Regs.Al and $40) = $40);
  26. end;
  27.  
  28. {
  29.  The Function comes back True only when a ring is currently happening so
  30. you can:
  31. }
  32.  
  33. begin
  34.   Repeat
  35.   Until CheckRing(2);      {Or Whatever comport}
  36.   Delay(1000);             {Give it a sec}
  37.   Writeln_Fossil('ATA'); {Or Whatever you use to Interface w/ the fossil}
  38.   While not CarrierDetect do Delay(250); {Suffecient Time}
  39.  
  40. {
  41.   Well that should answer the phone, now if you want to check the baud
  42. you can read a line from the modem or something.
  43. }
  44.